package com.cnhis.cloudhealth.clinical.hosnurse.hosparams.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.cnhis.cloudhealth.commons.dao.BaseDao;
@Repository
public class HosParamsDao extends BaseDao{
   
	public int checkExistsParameters(Map map)throws Exception{
		return (int) queryForExtObject("HosParams.checkExistsParameters", map);
	}
	public void insert_SYS_Parameters(Map map)throws Exception{
		insert("HosParams.insert_SYS_Parameters", map);
	}
	public void insert_SYS_UserParameters(Map map)throws Exception{
		insert("HosParams.insert_SYS_UserParameters", map);
	}
	public boolean check_SYS_Parameters(Map map)throws Exception{
		return (int)queryForExtObject("HosParams.check_SYS_Parameters", map)>0;
	}
	public void delete_SYS_UserParameters(Map map)throws Exception{
		delete("HosParams.delete_SYS_UserParameters", map);
	}
	public void delete_SYS_UserParameters1(Map map)throws Exception{
		delete("HosParams.delete_SYS_UserParameters1", map);
	}
	public Map getParams(Map map)throws Exception{
		return (Map) queryForExtObject("HosParams.getParams", map);
	}
	public Map getParams1(Map map)throws Exception{
		return (Map) queryForExtObject("HosParams.getParams1", map);
	}
	
	public int getMessageId()throws Exception{
		return (int) queryForExtObject("HosParams.getMessageId", null);
	}
	public void insert_SYS_EventLogs(Map map)throws Exception{
		insert("HosParams.insert_SYS_EventLogs", map);
	}
	public void update_SYS_Parameters(Map map)throws Exception{
		update("HosParams.update_SYS_Parameters", map);
	}
	public boolean check_SYS_Parameters1(Map map)throws Exception{
		return (int)queryForExtObject("HosParams.check_SYS_Parameters1", map)>0;
	}
	public void save_SYS_UserParameters(Map map)throws Exception{
		insert("HosParams.save_SYS_UserParameters", map);
	}
	public List queryAutoChargeSetting()throws Exception{
		return queryForList("HosParams.queryAutoChargeSetting", null);
	}
	
	public String getSysValue(int productId,int programId,int paramNo )throws Exception{
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("productid",productId);
		map.put("programid",programId);
		map.put("paramno", paramNo);
		return (String)queryToObject("HosParams.getSysParamValue",map);
	}
}
